<template>
    <el-card shadow="never">
        <yun-table
                :columns="columns"
                toolbar="refresh,del,recyclebin"
                :auth="{
                    del:{:$auth->check('app\\admin\\controller\\delivery\\channel\\Order','del')},
                    recyclebin:{:$auth->check('app\\admin\\controller\\delivery\\channel\\Order','recyclebin')},
                }"
                :extend="extend">
        </yun-table>
    </el-card>
</template>
<script>
    import table from "@components/Table.js";
    export default{
        components:{
            'YunTable':table
        },
        data:{
            extend:{
                index_url: 'delivery/channel-order/index',
                del_url: 'delivery/channel-order/del',
                recyclebin_url:'delivery/channel-order/recyclebin'
            },
            columns:[
                {checkbox: true},
                {field:"order_no",title:"订单号",width:200},
                {field:"goods_id",title:"下单商品",operate:{form:"selectpage",filter:"=",url:"delivery/channel-goods/index",labelField:"name",keyField:"id"},formatter:function (data,row){
                    let text=Yunqi.formatter.text;
                    text.value=row.goods?row.goods.name:'';
                    return text;
                }},
                {field:"user_id",title:"下单用户",operate:{form:"selectpage",filter:"=",url:"user/index/index",labelField:"nickname",keyField:"id"},formatter:function (data,row){
                    let text=Yunqi.formatter.text;
                    text.value=row.user?row.user.nickname:'';
                    return text;
                }},
                {field:"number",title:"下单数量",operate:false},
                {field:"price",title:"单价",operate:false},
                {field:"total_money",title:"合计金额",operate:false},
                {field:"total_score",title:"合计积分",operate:false},
                {field:"updatetime",title:"修改时间",operate:"daterange",formatter:Yunqi.formatter.datetime},
                {
                    field: 'operate',
                    title: __('操作'),
                    width:130,
                    action:{
                        del:true,
                    }
                }
            ]
        },
        methods: {
        }
    }
</script>
<style>
</style>